package com.xl.sst.biz.impl;



import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xl.sst.biz.DesiredBiz;
import com.xl.sst.dao.DesiredDao;
/*
 * 需求业务层
 */
import com.xl.sst.vo.Desired;
import com.xl.sst.vo.Page;

/*
 * 需求持久层
 */
@Service
public class DesiredBizImpl implements DesiredBiz{

	@Resource
	private DesiredDao DesiredDao;
	public DesiredDao getDesiredDao() {
		return DesiredDao;
	}
	public void setDesiredDao(DesiredDao desiredDao) {
		DesiredDao = desiredDao;
	}
	//添加需求
	public boolean add(Desired d) {
		return DesiredDao.add(d)==1?true:false;
	}
	//修改需求
	public boolean update(Desired d) {
		return DesiredDao.update(d)==1?true:false;
	}
	//删除需求
	public int delete(Desired d) {
		return DesiredDao.delete(d);
	}
	//根据用户id查询需求 我的需求
	public List<Desired> selectByUser(Desired d) {
		return DesiredDao.selectByUser(d);
	}
	//分类分页查询所有的需求  需求展示用到
	public List<Desired> selectAll(Page p) {
		return DesiredDao.selectAll(p);
	}
	//获取长度
	public int getCount(Page p) {
		return DesiredDao.getCount(p);
	}	


}
